package com.v.im.businessapi.feign;


import com.v.im.businessapi.api.ImUserInfoServiceAPI;
import com.v.im.businessapi.dto.paramDTO.ImUserParamDTO;
import com.v.im.businessapi.dto.resultDTO.ImUserResultDTO;
import com.v.im.commonmodule.utils.constants.InterfaceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 *  用戶信息客戶端
 */
@FeignClient(name = InterfaceService.BUSINESS_SERVICE_NAME, fallback = ImUserClientService.HystrixClientFallback.class)
public interface ImUserClientService extends ImUserInfoServiceAPI {

    @Slf4j
    @Component
    class HystrixClientFallback implements ImUserClientService {

        @Override
        public ImUserResultDTO getImUserByUserName(String userName) {
            log.error("调用用户信息服务失败");
            return null;
        }

        @Override
        public List<ImUserResultDTO> getImUserResults(String userIds) {
            log.error("调用用户信息服务失败");
            return null;
        }

        @Override
        public Boolean saveUser(ImUserParamDTO imUserParamDTO) {
            log.error("调用保存服务失败");
            return null;
        }

    }
}
